<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Coding Night - A personal blog for Rango</title>
  <meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">


<meta name="author" content="Rango" />






<meta name="generator" content="Hugo 0.97.3 with theme even" />


<link rel="canonical" href="https://rangolee.github.io/" />
  <link href="https://rangolee.github.io/index.xml" rel="alternate" type="application/rss+xml" title="Coding Night - A personal blog for Rango" />
  <link href="https://rangolee.github.io/index.xml" rel="feed" type="application/rss+xml" title="Coding Night - A personal blog for Rango" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">



<link href="/sass/main.min.a659bb31b17a54f7792e1bc783fc75b31118e6a175b42337b03fae0b1a3ef2b5.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.css" integrity="sha256-7TyXnr2YU040zfSP+rEcz29ggW4j56/ujTPwjMzyqFY=" crossorigin="anonymous">


<meta property="og:title" content="Coding Night - A personal blog for Rango" />
<meta property="og:description" content="" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://rangolee.github.io/" />

<meta itemprop="name" content="Coding Night - A personal blog for Rango">
<meta itemprop="description" content=""><meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Coding Night - A personal blog for Rango"/>
<meta name="twitter:description" content=""/>

<!--[if lte IE 9]>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js"></script>
<![endif]-->

<!--[if lt IE 9]>
  <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->

</head>
<body>
  <div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/" class="logo">Coding Night</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>
<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    <a href="/">
        <li class="mobile-menu-item">Home</li>
      </a><a href="/post/">
        <li class="mobile-menu-item">Archives</li>
      </a><a href="/tags/">
        <li class="mobile-menu-item">Tags</li>
      </a><a href="/categories/">
        <li class="mobile-menu-item">Categories</li>
      </a><a href="/about/">
        <li class="mobile-menu-item">About</li>
      </a>
  </ul>

  


</nav>

  <div class="container" id="mobile-panel">
    <header id="header" class="header">
        <div class="logo-wrapper">
  <a href="/" class="logo">Coding Night</a>
</div>





<nav class="site-navbar">
  <ul id="menu" class="menu">
    <li class="menu-item">
        <a class="menu-item-link" href="/">Home</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/post/">Archives</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/tags/">Tags</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/categories/">Categories</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/about/">About</a>
      </li>
  </ul>
</nav>

    </header>

    <main id="main" class="main">
      <div class="content-wrapper">
        <div id="content" class="content">
          <section id="posts" class="posts">
    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/ios/16-0607_contentmode%E5%92%8C-textfield-%E7%9A%84-leftviewmode-%E5%92%8C-rightviewmode/">UIImageView 的 contentMode 和 TextField 的 leftViewMode 和 rightViewMode</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2016-06-07 </span>
      
        <span class="more-meta"> 约 486 字 </span>
        <span class="more-meta"> 预计阅读 1 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <h3 id="1uiimageview-的-contentmode">1.UIImageView 的 contentMode</h3>
<hr>
<h5 id="uiimageview-的-contentmode-属性用来设置图片的显示方式如居中局左是否缩放等contentmode-是-uiviewcontentmode枚举类型-的属性主要有下面这些样式可供选择">UIImageView 的 contentMode 属性用来设置图片的显示方式,如居中,局左,是否缩放等,contentMode 是 UIViewContentMode(枚举类型) 的属性,主要有下面这些样式可供选择</h5>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-objective-c" data-lang="objective-c"><span class="line"><span class="cl"><span class="k">typedef</span> <span class="nf">NS_ENUM</span><span class="p">(</span><span class="n">NSInteger</span><span class="p">,</span> <span class="n">UIViewContentMode</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="n">UIViewContentModeScaleToFill</span><span class="p">,</span>       <span class="c1">//会导致图片变形
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>    <span class="n">UIViewContentModeScaleAspectFit</span><span class="p">,</span>      <span class="c1">// contents scaled to fit with fixed aspect. remainder is transparent --&gt;保证图片比例不变的最大显示图片,可能会有留白部分
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>    <span class="n">UIViewContentModeScaleAspectFill</span><span class="p">,</span>     <span class="c1">// contents scaled to fill with fixed aspect. some portion of content may be clipped. --&gt; 保证图片比例不变的情况下,填充整个 imageView 视图,可能只有部分图片显示
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>    <span class="n">UIViewContentModeRedraw</span><span class="p">,</span>              <span class="c1">// redraw on bounds change (calls -setNeedsDisplay)
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>    <span class="n">UIViewContentModeCenter</span><span class="p">,</span>              <span class="c1">// contents remain same size. positioned adjusted.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>    <span class="n">UIViewContentModeTop</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="n">UIViewContentModeBottom</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="n">UIViewContentModeLeft</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="n">UIViewContentModeRight</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="n">UIViewContentModeTopLeft</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="n">UIViewContentModeTopRight</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="n">UIViewContentModeBottomLeft</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="n">UIViewContentModeBottomRight</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"><span class="p">};</span>
</span></span></code></pre></td></tr></table>
</div>
</div><p>以上这些模式,带有 scale 的,当图片尺寸超过 imageView 的尺寸( frame)时,可能造成只有部分图片 内容会显示在 imageView 中,可以通过剪裁命令剪裁掉不在 imageView 视图之内的图片内容<code>self.myImageView.clipsToBounds = YES;</code></p>
    </div>
    <div class="read-more">
      <a href="/post/ios/16-0607_contentmode%E5%92%8C-textfield-%E7%9A%84-leftviewmode-%E5%92%8C-rightviewmode/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/16-0606_mac%E6%90%AD%E5%BB%BAmysql%E7%8E%AF%E5%A2%83/">Mac OS 搭建 mysql 环境</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2016-06-06 </span>
      <div class="post-category">
          <a href="/categories/ios/"> iOS </a>
          </div>
        <span class="more-meta"> 约 506 字 </span>
        <span class="more-meta"> 预计阅读 2 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      1. MySQL Wiki 双击 mysql-5.6.12-osx10.7-x86_64.dmg 双击 mysql-5.6.12-osx10.7-x86_64.pkg 双击 MySQL.prefPane 系统偏好设置里启动 MySQL 验证 1 2 3 4 Rango-MBP:~ rango$ cd /usr/local/mysql Rango-MBP:mysql rango$ cd bin Rango-MBP:bin rango$ pwd /usr/local/mysql/bin 登入MySQL服务器,首次登入无密码,直接回车即可 看到下面这
    </div>
    <div class="read-more">
      <a href="/post/16-0606_mac%E6%90%AD%E5%BB%BAmysql%E7%8E%AF%E5%A2%83/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/16-0606_mac%E4%B8%8B%E5%AE%89%E8%A3%85%E5%92%8C%E9%85%8D%E7%BD%AEtomcat/">mac 安装和配置 tomcat(不借助 eclipse)</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2016-06-06 </span>
      <div class="post-category">
          <a href="/categories/mac/"> Mac </a>
          </div>
        <span class="more-meta"> 约 559 字 </span>
        <span class="more-meta"> 预计阅读 2 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <h3 id="1安装-tomcat">1.安装 tomcat</h3>
<hr>
<h5 id="1-去-java官网httpwwworaclecomtechnetworkjavajavasedownloadsindexhtml下载-jdk-安装包然后一步一步先安装jdk">1. 去 <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Java官网</a>下载 JDK 安装包,然后一步一步先安装JDK</h5>
<h5 id="2-去-apache官网httptomcatapacheorgindexhtml下载-mac-版本的完整-targz-文件包解压拷贝到主目录并重新命名为-tomcat其他目录页可以">2. 去 <a href="http://tomcat.apache.org/index.html">Apache官网</a>下载 Mac 版本的完整 <code>***tar.gz</code> 文件包,解压拷贝到<code>~/</code>主目录,并重新命名为 tomcat(其他目录页可以).</h5>
<h5 id="3-修改文件权限进入终端-cd-到刚才的目录">3. 修改文件权限,进入终端 <code>cd</code> 到刚才的目录</h5>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">Rango-MBP:~ rango$ <span class="nb">cd</span> tomcat/bin/
</span></span></code></pre></td></tr></table>
</div>
</div><h5 id="5-修改文件权限需要输入登录密码输入后按回车就可">5. 修改文件权限,需要输入登录密码,输入后按回车就可</h5>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">Rango-MBP:bin rango$ sudo chmod <span class="m">755</span> *.sh
</span></span><span class="line"><span class="cl">Password:
</span></span></code></pre></td></tr></table>
</div>
</div>
    </div>
    <div class="read-more">
      <a href="/post/16-0606_mac%E4%B8%8B%E5%AE%89%E8%A3%85%E5%92%8C%E9%85%8D%E7%BD%AEtomcat/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/ios/16-0604_fmdb/">FMDB</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2016-06-04 </span>
      <div class="post-category">
          <a href="/categories/ios/"> iOS </a>
          </div>
        <span class="more-meta"> 约 530 字 </span>
        <span class="more-meta"> 预计阅读 2 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      1.创建表 create table people(id integer,name text,height real); 有主键字段特征：自增性，唯一性 create table student(id integer,name text,height real); 2.增（student 表、有主键字段表） - 直接插入（保证 id 字段的唯一性） insert into
    </div>
    <div class="read-more">
      <a href="/post/ios/16-0604_fmdb/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/ios/16-0603_sqlite%E8%BF%94%E5%9B%9E%E5%80%BC/">SQLite 返回值</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2016-06-03 </span>
      <div class="post-category">
          <a href="/categories/ios/"> iOS </a>
          </div>
        <span class="more-meta"> 约 897 字 </span>
        <span class="more-meta"> 预计阅读 2 分钟 </span>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      SQLite 返回值 1 2 3 4 5 6 7 8 9 10 11 /* ** CAPI3REF: Result Codes //返回码 ** KEYWORDS: {result code definitions} ** ** Many SQLite functions return an integer result code from the set shown ** here in order to indicate success or failure. ** ** New error codes may be added in future versions of SQLite. ** ** See also:
    </div>
    <div class="read-more">
      <a href="/post/ios/16-0603_sqlite%E8%BF%94%E5%9B%9E%E5%80%BC/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    </section>
  
  <nav class="pagination">
    <a class="prev" href="/page/4/">
        <i class="iconfont icon-left"></i>
        <span class="prev-text">上一页</span>
      </a>
    <a class="next" href="/page/6/">
        <span class="next-text">下一页</span>
        <i class="iconfont icon-right"></i>
      </a>
  </nav>
        </div>
        

      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="social-links">
      <a href="mailto:rangodev@163.com" class="iconfont icon-email" title="email"></a>
  <a href="https://rangolee.github.io/index.xml" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
</div>

<div class="copyright">
  <span class="power-by">
    由 <a class="hexo-link" href="https://gohugo.io">Hugo</a> 强力驱动
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    主题 - 
    <a class="theme-link" href="https://github.com/olOwOlo/hugo-theme-even">Even</a>
  </span>

  

  <span class="copyright-year">
    &copy; 
    2016 - 
    2022<span class="heart"><i class="iconfont icon-heart"></i></span><span>Rango</span>
  </span>
</div>

    </footer>

    <div class="back-to-top" id="back-to-top">
      <i class="iconfont icon-up"></i>
    </div>
  </div>
  
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/slideout@1.0.1/dist/slideout.min.js" integrity="sha256-t+zJ/g8/KXIJMjSVQdnibt4dlaDxc9zXr/9oNPeWqdg=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.js" integrity="sha256-XVLffZaxoWfGUEbdzuLi7pwaUJv1cecsQJQqGLe7axY=" crossorigin="anonymous"></script>



<script type="text/javascript" src="/js/main.min.64437849d125a2d603b3e71d6de5225d641a32d17168a58106e0b61852079683.js"></script>








</body>
</html>
